(function ($) {
    $.verificationItem = function(t,p){
        var  options = $.extend(true, {

        }, p);
        var reg = $(t).attr("reg");
        if(reg) {
            var regexp = new RegExp(reg);
            if (regexp.test($(t).val())) {
                return true;
            } else {
                $(t).addClass("ui-state-error");
                $(t).focus();
                return false;
            }
        }

    };

    $.fn.verification = function (p) {
        this.removeClass("ui-state-error");
        var flag = true;
        this.each(function (index,item) {
            flag &= $.verificationItem(item,p);
        });
        return flag;

    };

    $.fn.getFlexigridiAttrByIndex=function(findIndex) {
        var descList = [];
        var  selectedDom = $(this).find(".trSelected");
        selectedDom.each(function (index,item) {
            var ch = $(item).attr("ch");
            var atttrs = ch.split("_FG$SP_");
            $(atttrs).each(function (indexCh,itemCh) {
                if(indexCh === findIndex){
                    descList.push(itemCh)
                }
            });

        });
        return descList;
    };
})(jQuery);